from NumberedMusicalNotation import NumberedMusicalNotation 
from machine import Pin,PWM

pwm = PWM(0,Pin(7))

nmn = NumberedMusicalNotation(pwm)

nmn.speed(137)

nmn.timeSignature(4)

# 《钟离·听书人》
tsrMusicList = [
    '5', '6', '+1.', '5_',
    '6', '+2', '+1', '+2__', '+1__', '6_', '4_',
    '5', '6', '2.', '6_',
    '5_', '6_' '+1', '6', '+1__', '6__', '5_', '4_',

    '+5', '+6', '++1.', '+5_',
    '+6', '++2', '++1', '++2__', '++1__', '+6_', '+4_',
    '+5', '+6', '+2.', '+6_',
    '+5_', '+6', '++1', '+6', '++1',
    '++2...'
]

# 《深海少女》
shsnMusicList = [
    '+1_', '+2_',
    '+3_', '+2_', '+3_', '+5_', '+2', '7_', '7_',
    '+1', '7_', '6_', '7_', '5_', '0_', '5_',
    '6', '+1', '+2_', '+1_', '+2_', '+2_',

    '+2', '+3', '0', '+1_', '+2_',
    '+3_', '+2_', '+3_', '+5_', '+7', '+5_', '+5_',
    '+6_', '+5_', '+3_', '+5_', '+5', '0_', '+1__', '+2__',
    '+3_', '+1_', '0_', '+1__', '+1__', '+2_', '7_', '5_', '7_',
    
    '7', '7_', '6_', '6', '0_', '+2_',
    '+3_', '+2_', '+3_', '+5_', '+2_', '0_', '7',
    '+1_', '+1_', '7_', '6_', '7.', '5_',
    '6', '+1_', '+1_', '+2_', '+1__', '+1__', '+2_', '+2_',

    '+2_', '+1_', '+2_', '+5_', '+3_.', '0__', '+1_', '+2_',
    '+3_', '+2_', '+3_', '+5_', '+7', '++1_', '+7_',
    '+6_', '+5_', '+3_', '+5_', '+5', '0_', '+1__', '+2__',
    '+3_', '+2_', '+1_', '7_', '+2_', '7_', '5_', '7_',
    
    '7', '7_', '6_', '6', '0_'
]

for monophonic in shsnMusicList:
    nmn.playNotation(monophonic, 2)

pwm.deinit()